<!--{Atemplate public/tpl/header}-->

<!--{eval echo $this->Ahtml_js_aurl();}-->
<script>
function checkall(value,mod,val) {
	var mods = '';
	var vals = '';
	if(mod){
		mods = '._mod_'+mod+' ';
	}
	var dom = mods+"input[type=\"checkbox\"]";
	if(val || val=='0'){
		vals = ' value=\"'+val+'\"';
		dom = mods+"input["+vals+"]";
	}
	if(value=='0'){
		jQuery(dom).attr("checked","checked");
	}
	if(value=='1'){
		jQuery(dom).removeAttr("checked","checked");
	}
	if(value=='auth'){
		var chkall = jQuery("input:checked").val();
		if(chkall == null){
			alert('请先选择');
			return false;
		}else{
			return true;
		}
	}
}
function mode_hide(mod){
	jQuery("._mod_"+mod+" dl").toggleClass('dis_none');
}


jQuery(function(){
	jQuery(".checkbox").change(function (){
		if(jQuery("input:checked").val()){
			jQuery("#chkall_del").removeAttr("disabled","disabled");
		}else{
			jQuery("#chkall_del").attr("disabled","disabled");
		}
	});
})
</script>


<form action="" method="POST">
<div class="_app">
	<h2 class="title">用户组:$info[title]</h2>
	<p>
		<input type="button" class="_btn" onclick="checkall(0,'',0);" value="无权限">
		<input type="button" class="_btn" onclick="checkall(0,'',1);" value="读取">
		<input type="button" class="_btn" onclick="checkall(0,'',2);" value="写入">
		<input type="button" class="_btn" onclick="checkall(0,'',3);" value="所有">
		<input type="submit" class="_btn" name="submit" value="全部保存" onClick="javascript:form.action='';" />
		<input type="button" class="_btn" name="button" value="返回用户组" onClick="javascript:location.href='$this->Amodr-list';" />
	</p>
	<h2>公共权限:</h2>
<!--{loop $public $key $val}-->
	<div class="_mod _mod_$key">
		<p>
			<b class="_btn" onclick="mode_hide('$key')">模块:$val[title]</b>
			<span>
			<input type="button" class="_btn" onclick="checkall(0,'$key',0);" value="无权限">
			<input type="button" class="_btn" onclick="checkall(0,'$key',1);" value="读取">
			<input type="button" class="_btn" onclick="checkall(0,'$key',2);" value="写入">
			<input type="button" class="_btn" onclick="checkall(0,'$key',3);" value="所有">
			</span>
		</p>
		<dl class="-dl dis_none">
		<!--{loop $val[act] $k $v}-->
			<dt>功能:$v[title] ($k)</dt>
			<dd><!--{form 'radio','save[public]['.$key.']['.$k.']',$form_val_status,'',$data->public->$key->$k}--></dd>
		<!--{/loop}-->
		</dl>
	</div>
<!--{/loop}-->
	<h2>应用权限:</h2>
<!--{loop $list $key $val}-->
	<div class="_mod _mod_$key">
		<p>
			<b class="_btn" onclick="mode_hide('$key')">模块:$val[title]</b>
			<span>
			<input type="button" class="_btn" onclick="checkall(0,'$key',0);" value="无权限">
			<input type="button" class="_btn" onclick="checkall(0,'$key',1);" value="读取">
			<input type="button" class="_btn" onclick="checkall(0,'$key',2);" value="写入">
			<input type="button" class="_btn" onclick="checkall(0,'$key',3);" value="所有">
			</span>
		</p>
		<dl class="-dl">
		<!--{loop $val[act] $k $v}-->
			<dt>功能:$v[title] ($k)</dt>
			<dd><!--{form 'radio','save['.Acan_app_name.']['.$key.']['.$k.']',$form_val_status,'',$data->{Acan_app_name}->$key->$k}--></dd>
		<!--{/loop}-->
		</dl>
	</div>
<!--{/loop}-->
	<p>
		<input type="button" class="_btn" onclick="checkall(0,'',0);" value="无权限">
		<input type="button" class="_btn" onclick="checkall(0,'',1);" value="读取">
		<input type="button" class="_btn" onclick="checkall(0,'',2);" value="写入">
		<input type="button" class="_btn" onclick="checkall(0,'',3);" value="所有">
		<input type="submit" class="_btn" name="submit" value="全部保存" onClick="javascript:form.action='';" />
		<input type="button" class="_btn" name="button" value="返回用户组" onClick="javascript:location.href='$this->Amodr-list';" />
	</p>
</div>
</form>

<!-- 分页 -->
$apage


<!--{Atemplate public/tpl/footer}-->